#include "stdafx.h"
#include "Ability.h"
#include "BonusDamageStatus.h"

VOID BonusDamageStatus::Init( Character *pOwner, Character *pAttacker, Ability *pAbility )
{
	AbilityStatus::Init( pOwner, pAttacker, pAbility );

	BASE_ABILITYINFO *pBaseAbilityInfo = pAbility->GetBaseAbilityInfo();
	m_eAttackType = (eATTACK_TYPE)pBaseAbilityInfo->m_iOption1;
}

VOID BonusDamageStatus::AddDamage( eATTACK_TYPE attackType, DAMAGETYPE &wDamage )
{
	if( m_eAttackType != attackType )	return;

	int iValue = m_iValue;
	if( m_iValueType == VALUE_TYPE_PERCENT_PER_MAX )			iValue = wDamage * iValue / 1000;
	else if( m_iValueType == VALUE_TYPE_PERCENT_PER_CUR )		iValue = wDamage * iValue / 1000;

	wDamage += iValue;
}






